<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<!-- 渲染优化 -->
		<meta name="renderer" content="webkit">
		<meta name="force-rendering" content="webkit">
		<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
		<meta name="HandheldFriendly" content="True">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
		<title id="title">主页</title>
		<link rel="shortcut icon" href="img/favicon.png">
		<script src="/assets/js/av-min.js">
		</script>
	</head>
	<style>
/*下方这句不动它，翻译开始*/ * 
/*翻译 主页整体样式 文本对齐︰ 中心;
	背景色︰
		#f1f6ee 使用夜间默认时修改为#000000即可
}
*/ body {
	margin:0px;
	padding:0px;
	text-align:center;
	background-image:url('/assets/img/back.png')
		!important;
	/*可换上面的图片地址*/ background-size:100% !important;
	background-repeat:no-repeat;
	background-color:#ffffff;
	/*可删上面的固定句语*/
}
/*翻译 搜索栏字体样式 宽度︰
		90%;
	高度︰ 40px;
	背景颜色︰ 透明;
	边境︰ 无;
	大纲︰ 0;
	字体大小︰ 18px;
	字体颜色:#000000;
	填充︰ 0
		20px;
	边界半径︰ 50px
}
*/ #search_input {
	width:100%;
	height:40px;
	background-color:transparent;
	border:none;
	outline:0;
	font-size:16px;
	padding:0 5px;
	border-radius:50px
}
/*翻译 搜索框边距 下边距︰ 30px;
	上边距︰ 20px;
	*/ .search_part {
	margin-bottom:5px;
	margin-top:15px;
}
/*翻译 跨度样式 显示︰
		阻止;
	溢出︰ 隐藏;
	左填充︰ 5px;
	垂直对齐︰ 居中;
	*/ .search_bar span {
	display:block;
	font-size:12px;
	overflow:hidden;
	padding-left:2px;
	margin-right:42px;
	vertical-align:middle;
}
.search_bar span i {
	display:none;
	float:right;
	width:35px;
	height:40px;
	background:url(img/clear.png) no-repeat center;
	background-size:16px;
}
.search_bar .si {
	margin:0 38px 0 10px;
}
/*搜索建议条*/ 
#suggest {
	position:absolute;
	left:-1px;
	right:-1px;
	top:40px;
	border:1px solid
		#ccc;
	background:#fff;
	line-height:25px;
}
#suggest ul {
	height:200px;
    overflow-y:scroll;
    padding-inline-start:8px;
}
#suggest li {
	list-style-type:none;
	border-bottom:1px solid #ccc;
	text-align:left;
	cursor:pointer;
	padding:0 8px;
}
#suggest li:active {
	background:#F0F0F0;
}
#suggest li:hover {
	color:blue;
}
#suggest li b {
	float:right;
	width:44px;
	height:25px;
	background:url(data:image/png;
	base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAI5JREFUSEtjZCACLF261J6RkbELpPT///9l0dHRB4nQRlgJ0ODny5Yt+w/CIDZhHUSqgBkKo4nURljZqMHwMBohQQFK/ECvnkT3LgX8kyAzGZATPwWGgTMPSiYCGvyEWgYiGfyEAcjxoKaroWZ5EM52QBUjJLkRExajQUH7Qgg5E4HYxMQLUWpgmYiUxA8AOdLMz+iDKvIAAAAASUVORK5CYII=)
		no-repeat scroll center center #fff;
	background-size:11px;
}
#suggest
		.close {
	text-align:right;
	font-size:14px;
	color:#888;
	padding-right:12px;
}
/*翻译 搜索栏框架样式 {
	框阴影︰ 0 0 18px rgba(70,70,40,.255);
	括号里的颜色为Rgb默认，可进入http://rgb.phpddt.com/查询
		-webkit 动画︰ fadeIn 2.5;
	动画︰ fadeIn 2.5;
	背景色︰ rgba(255,255,255,.100);
	边界半径︰
		50px;
	显示︰ 表;
	垂直对齐︰ 居中;
	宽度︰ 80%;
	根据你喜欢的宽度调整，目前我为了对齐图标使用80% 高度︰ 40px;
	最大宽度︰
		400px;
	边距︰ 10px 默认布局;
}
*/ .search_bar {
	box-shadow:0 0 5px rgba(70,70,40,.255);
	-webkit-animation:fadeIn 2.5s;
	animation:fadeIn 2.5s;
	background-color:rgba(255,255,255,.0);
	border-radius:3px;
	display:table;
	vertical-align:middle;
	width:85%;
	height:20px;
	max-width:400px;
	margin:10px auto;
	position:relative;
	z-index:10;
}
/*翻译 搜索栏搜索目标确认图标样式，目前为米奇 轮廓边框︰ 0;
	高度︰
		40px;
	浮标位置︰ 右;
	颜色:#000;
	字体大小︰ 16px;
	字体粗细︰ 700;
	边境︰ 无;
	背景颜色︰ 透明;
	填充︰ 0
		13px 0 13px */ 
#search_submit {
	outline:0;
	height:40px;
	float:right;
	font-size:18px;
	font-weight:500;
	border:none;
	background-color:transparent;
	padding:0 13px 0 13px;
	cursor:pointer;
}
/*翻译 书签图标排版目录样式 宽度︰ 100%;
	文本对齐︰ 中心;
	填充顶部︰ 15px;
	填充底部︰ 15px;
	*/ 
#content {
	width:100%;
	text-align:center;
	padding-top:0px;
	padding-bottom:0px;
}
/*翻译 书签框架样式 -webkit 动画︰ fadeInDown
		1s;
	动画︰ fadeInDown 1s;
	位置︰ 相对应;
	显示︰ 显示在内部;
	宽度︰ 75px;
	边境︰ 0;
	*/ .box {
	-webkit-animation:fadeInDown 1s;
	animation:fadeInDown 1s;
	position:relative;
	display:inline-block;
	width:70px;
	border:0;
}
/*翻译 书签图标样式 宽度︰ 100%;
	高度︰ 100%;
	位置︰ 不受限制;
	左︰
		0;
	顶︰ 0;
	*/ .box a {
	width:100%;
	height:100%;
	position:absolute;
	left:0;
	top:0;
}
 .box p {
	margin-block-start:8px;
	margin-block-end:8px;
}
/*翻译 书签字体样式 颜色:#232323;
	使用夜间模式时修改为#eee或者#f2eada即可 高度︰ 1.5em;
	线的高度︰ 1.5em;
	宽度︰ 72px;
	字体大小︰ 0.75em;
	白色空间︰ nowrap;
	溢出︰ 隐藏;
	边距︰ 默认布局;
	-webkit
		边框顶部右半径︰ 5px;
	-webkit 边框底部右半径︰ 5px;
	文本溢出︰ 省略;
	-o 文本溢出︰ 省略;
	气相色谱-质谱-文本-溢出︰
		省略;
	填充顶部︰ 3px;
	填充底部︰ 8px;
	*/ .url {
	color:#4a4266;
	height:1.5em;
	line-height:1.5em;
	width:72px;
	font-size:0.75em;
	white-space:nowrap;
	overflow:hidden;
	margin:auto;
	-webkit-border-top-right-radius:5px;
	-webkit-border-bottom-right-radius:5px;
	text-overflow:ellipsis;
	-o-text-overflow:ellipsis;
	-ms-text-overflow:ellipsis;
	padding-top:0px;
	padding-bottom:8px;
}
/*翻译 字体样式 宽度︰ 3em;
	高度︰
		3em;
	最大宽度︰ 72px;
	*/ .icon {
	width:3em;
	height:3em;
	max-width:72px;
}
#app-items {
	width:100%;
	max-width:400px;
	margin:0px auto;
	text-align:center;
	background-color:#fff;
	padding-top:0px;
	padding-bottom:15px;
}
.title {
	background-color:#fffffff;
	font-size:16px;
	height:30px;
	line-height:30px;
	padding:0 10px 0 20px;
	color:#4a4266;
}
#yiyan {
	width:100%;
	max-width:400px;
	margin:0px auto;
	text-align:center;
	background-color:#fff;
	padding-top:0px;
	padding-bottom:15px;
}
.shuxing {
	color:#4a4266;
	font-size:12px;
	height:30px;
	line-height:20px;
	padding:0 10px 0 20px;
}
@-webkit-keyframes
		flipInX {
	0% {
	-webkit-transform:perspective(400px) rotateX(90deg);
	transform:perspective(400px) rotateX(90deg);
	opacity:0
}
40% {
	-webkit-transform:perspective(400px) rotateX(-10deg);
	transform:perspective(400px) rotateX(-10deg)
}
70% {
	-webkit-transform:perspective(400px) rotateX(10deg);
	transform:perspective(400px) rotateX(10deg)
}
100% {
	-webkit-transform:perspective(400px)
		rotateX(0);
	transform:perspective(400px) rotateX(0);
	opacity:1
}
}@keyframes
		flipInX {
	0% {
	-webkit-transform:perspective(400px) rotateX(90deg);
	-ms-transform:perspective(400px) rotateX(90deg);
	transform:perspective(400px) rotateX(90deg);
	opacity:0
}
40% {
	-webkit-transform:perspective(400px) rotateX(-10deg);
	-ms-transform:perspective(400px) rotateX(-10deg);
	transform:perspective(400px)
		rotateX(-10deg)
}
70% {
	-webkit-transform:perspective(400px) rotateX(10deg);
	-ms-transform:perspective(400px) rotateX(10deg);
	transform:perspective(400px)
		rotateX(10deg)
}
100% {
	-webkit-transform:perspective(400px) rotateX(0);
	-ms-transform:perspective(400px) rotateX(0);
	transform:perspective(400px)
		rotateX(0);
	opacity:1
}
}@-webkit-keyframes fadeIn {
	0% {
	opacity:0
}
100% {
	opacity:1
}
}@keyframes fadeIn {
	0% {
	opacity:0
}
100% {
	opacity:1
}
}@-webkit-keyframes fadeInDown {
	0% {
	opacity:0;
	-webkit-transform:translateY(-20px);
	transform:translateY(-20px)
}
100% {
	opacity:1;
	-webkit-transform:translateY(0);
	transform:translateY(0)
}
}@keyframes fadeInDown {
	0% {
	opacity:0;
	-webkit-transform:translateY(-20px);
	-ms-transform:translateY(-20px);
	transform:translateY(-20px)
}
100% {
	opacity:1;
	-webkit-transform:translateY(0);
	-ms-transform:translateY(0);
	transform:translateY(0)
}
}
	</style>
	<body>
		<div id="content">
			<br />
			<div class="search_part">
				<img class="smaller" src="http://wx3.sinaimg.cn/large/da6ac54fgy1ftvsol0ytmg20oh0b4npe.gif"
				width=33%>
				</img>
				<form id="search_form" onsubmit="return search()" class="search_bar">
					<input type="submit" id="search_submit" value="☯">
					<span>
						<i id="clear" onclick="clear_seach()">
						</i>
						<div class="si">
							<input class="search" type="text" value="" onkeyup="get_suggest()" onfocus="get_suggest()"
							onpaste="get_suggest()" autocomplete="off" id="search_input" placeholder="✎...  偷得浮生半日闲～">
						</div>
					</span>
					<div id="suggest" style="display:none">
						<ul id="suglist">
						</ul>
						<div class="close" onclick="close_sug()">
							| 收起
						</div>
					</div>
				</form>
			</div>
			<div style="text-align:center;"</div>
			<!--<iframe frameborder="no" border="0" marginwidth="0" marginheight="0" width=400 height=210 src="http://music.163.com/outchain/player?type=0&id=692469559&auto=1&height=230"></iframe>-->
			<br>
			<br>
			<br>
			<br>
			<br>
			<br>
			<br>
			<br>
			<br>
		<div style="display:none">
			<br />
			<div class="box">
				<a href="https://music.163.com">
				</a>
				<p>
					<img class="icon" src="img/wangyiyunyinyue.png">
				</p>
				<p class="url">
					网易云
				</p>
			</div>
			<div class="box">
				<a href="https://pan.baidu.com">
				</a>
				<p>
					<img class="icon" src="img/baiduyun.png">
				</p>
				<p class="url">
					百度云
				</p>
			</div>
			<div class="box">
				<a href="chrome://history" target="_blank">
				</a>
				<p>
					<img class="icon" src="img/lishi.png">
				</p>
				<p class="url">
					足迹
				</p>
			</div>
			<div class="box">
				<a href="chrome://bookmarks" target="_blank">
				</a>
				<p>
					<img class="icon" src="img/shuqian.png">
				</p>
				<p class="url">
					书签
				</p>
			</div>
		</div>
			<br>
			<font color="#303030">
				<font size="6">
					―·❀·―
				</font>
				<table width="32" border="0">
		</div>
		<!-- 如若要添加可复制一段 <div class="box">
		<a href="地址"></a>
		<p><img class="icon" src="img/icon6.png" ></p>
		<p class="url">书签名称</p>
		</div>
		其中链接在href中如href="地址"建议填写folder://自己创建的文件夹地址，这样创建一次不必再修改
		图标文件放置在img文件夹中定义如src="img/icon6.png"
		显示的标题在<p class="url">书签名称</p>之间定义如<p class="url">酷安</p>
		下方window.location.href =主页搜索引擎地址，目前为自用Pc版百度内部搜索，加上浏览器的顶部搜索即为双搜索，使用更方便
		-->
		<!--<div id="yiyan" style=" width: 500px; background-color:rgba(255, 255,
		255, 0); ">
		<br />
		<br />
		<script src="hitokoto.js"></script>
		<script>
		var num=Math.random();
		if(num>=0.6){
		var url="https://hitoapi.cc/sp/"
		var ajax = new XMLHttpRequest();
		ajax.onreadystatechange=function()
		{
		if (ajax.readyState==4 && ajax.status==200)
		{
		var hit = JSON.parse(ajax.responseText);
		document.getElementById("yiyan").innerHTML="<br />"+hit.text+"<br> &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp——"+hit.author;
		}
		}
		ajax.open('GET',url, true);
		ajax.send();
		}
		else{
		var count=Math.floor(Math.random()*hit.length);
		var ran=hit[count];
		var text=ran.hitokoto;
		var author=ran.source;
		/*var ajax = new XMLHttpRequest();
		ajax.onreadystatechange=function()
		{
		if (ajax.readyState==4)
		{
		alert(ajax.status);
		alert(ajax.responseText);
		var hit = JSON.parse(ajax.responseText);
		var ran=hit(Math.random(hit.length-2)+lit.length);
		var text=ran.hitokoto;
		var author=ran.source;
		document.getElementById("yiyan").innerHTML="<br />"+text+"<br> &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp——"+author;
		}
		}
		ajax.open('GET','customHitokotoB.json', true);
		ajax.send();
		*/
		document.getElementById("yiyan").innerHTML="<br />"+text+"<br> &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp——"+author;
		}
		</script>
		<br>-->
		<div class="lwlhitokoto">
			<script type="text/javascript" src="https://api.yum6.cn/djt/index.php?encode=js">
			</script>
			<span>
			</span>
			<p>
				<script>
					binduyan();
				</script>
			</p>
		</div>
		</div>
		<script type="text/javascript">
			var last_kw = '';
var max_sug_len = 1; //搜索建议最短触发长度

/*获取搜索建议
采用的神马搜索的服务
*/
function get_suggest() {
    var kw = document.getElementById('search_input').value;
    var clear = document.getElementById('clear');
    if (kw) clear.style.display = 'block';
    else clear.style.display = 'none';
    if (kw == last_kw) return;
    last_kw = kw;
    if (!kw || kw.length < max_sug_len) {
        close_sug();
        return;
    }
    var script = document.createElement('script');
    script.type = 'text/javascript';
    script.src = 'http://sugs.m.sm.cn/web?t=w&uc_param_str=dnnwnt&scheme=http&fr=android&bid=1&q=' + encodeURIComponent(kw) + '&_=' + new Date().getTime() + '&callback=jsonp3';
    var head = document.querySelector('head');
    script.onload = function() {
        head.removeChild(script);
    };
    head.appendChild(script);
}

function jsonp3(res) {
    var suggest = document.getElementById('suggest');
    if (!res.r || !res.r.length) {
        suggest.style.display = 'none';
        return;
    }
    var html = '';
    res.r.forEach(function(v) {
        html += '<li>' + v.w + '<b></b></li>';
    });
    document.getElementById('suglist').innerHTML = html;
    suggest.style.display = 'block';
}

function close_sug() {
    last_kw = '';
    document.getElementById('suggest').style.display = 'none';
}

function move_input() {
    document.body.scrollTop = document.getElementById('search_form').offsetTop - 2;
}

function clear_seach() {
    var input = document.getElementById('search_input');
    input.value = '';
    document.getElementById('clear').style.display = 'none';
    close_sug();
    input.focus();
}

function search() {
    if (document.getElementById("search_input").value != "") {
        // 声明 class
        const SearchHistory = AV.Object.extend('SearchHistorys');
        // 构建对象
        const sh = new SearchHistory();
        // 为属性赋值
        sh.set('msg', document.getElementById("search_input").value);
        sh.set('key',key);
        // 将对象保存到云端
        sh.save().then((sh) => {
            // 成功保存之后，执行其他逻辑
            console.log(`保存成功`);
            window.location.href = "https://www.baidu.com/s?ie=utf-8&rn=30&rsv_enter=0&wd=" + encodeURIComponent(document.getElementById("search_input").value) + "&from=smor&safe=1&snum=1";
        document.getElementById("search_input").value = "";
        }, (error) => {
            // 异常处理
            console.log(`保存失败`);
        });
    }
    return false;
}

document.getElementById('suglist').addEventListener('click', function(e) {
    var input = document.getElementById('search_input');
    if (e.target.tagName == 'B') {
        input.value = e.target.parentNode.firstChild.textContent;
        input.focus();
    } else if (e.target.tagName == 'LI') {
        input.value = e.target.firstChild.textContent;
        close_sug();
        search();
    }
});
window.addEventListener('resize', move_input);
document.getElementById('search_input').addEventListener('click', function(e) {
    var input = document.getElementById('search_input');
    if (input.value == '' || input.value == undefined || input.value == null) {
        //显示历史
        jsonp3(context);
    }
});

function login() {
	if(localStorage.getItem("key")==null){
		key = parseInt(Math.random()*(9999999-1000000+1)+1000000,10);
Math.floor(Math.random()*(9999999-1000900+1)+100000);
        localStorage.setItem("key",key);
	}else{
		key=localStorage.getItem("key");
	}
    AV.init({
        appId: "jk2vXseRAzJR3rePfsSD1dI7-MdYXbMMI",
        appKey: "Owi4A0EpLx81qBIvi5XmVvgi"
    });
    var username = "ekworp";
    var password = "ekworp";
    // LeanCloud - 登录
    AV.User.logIn(username, password).then(function(loginedUser) {
        console.log("signed");
        setupData();
    }, function(error) {
        alert(JSON.stringify(error));
    });
};
var context = {
    r: []
};

function setupData() {
    // LeanCloud - 查询
    var query = new AV.Query('SearchHistorys');
    query.descending('createdAt');
    query.limit(50);
    query.equalTo('key', key);
    query.find().then(function(SearchHistorys) {
        SearchHistorys.forEach(function(SearchHistory) {
            // handlebars context
            context.r.push({
                "w": SearchHistory.get('msg')
            });
        });
    }).catch(function(error) {
        alert(JSON.stringify(error));
    });
};
window.onload = function() {
    login();
}
var d = new Date();
var time = d.getHours();
if (time < 24) 
{
document.getElementById("title").innerHTML="Good evening!";
}
if (time < 19) 
{
document.getElementById("title").innerHTML="Good afternoon!";
}
if (time < 12) 
{
document.getElementById("title").innerHTML="Good morning!";
}
if (time < 5) 
{
document.getElementById("title").innerHTML="Go to sleep!";
}
var key = null;
		</script>
	</body>

</html>